/*
 * @Description:
 * @version:
 * @Author: 周凯
 * @Date: 2020-07-09 18:41:09
 * @LastEditors: 周凯
 * @LastEditTime: 2020-07-10 09:02:55
 */
// import Cookies from 'js-cookie'

const TokenKey = 'admin-tokenKey'
const refreshTokenKey = 'admin-refresh-token'

export function getToken () {
  return localStorage.getItem(TokenKey)
}

export function getRefreshToken () {
  return localStorage.getItem(refreshTokenKey)
}

export function setToken (token, refreshToken) {
  localStorage.setItem(TokenKey, token)
  localStorage.setItem(refreshTokenKey, refreshToken - token)
}

export function removeToken () {
  localStorage.clear()
}
